package it.win4buy.presentations
{
    import flash.events.IEventDispatcher;
    import flash.geom.Utils3D;

    import it.win4buy.events.NavigationEvent;
    import it.win4buy.utility.ApplicationConstants;
    import it.win4buy.utility.LoggerUtilty;

    import mx.utils.ObjectUtil;

    /**
     *
     *	autore:
     *  pierangelo.mancusi@gmail.com
     *
     */

    public class ApplicationContainerPM
    {

        //-------------------------------------------
        //
        // Injected properties
        //
        //-------------------------------------------


        [Dispatcher]
        public var dispatcher:IEventDispatcher;


        [Inject]
        /**
         * Used to write message to the Console or log file
         */
        public var log:LoggerUtilty;

        //-------------------------------------------
        //
        // Private Properties
        //
        //-------------------------------------------

        /**
         * Used to store  View's visualizing
         */
        private var _currentStateView:String;

        //-------------------------------------------
        //
        // Getters / Setters
        //
        //-------------------------------------------

        [Bindable]
        public function get currentStateView():String
        {
            return _currentStateView;
        }

        public function set currentStateView(value:String):void
        {
            _currentStateView=value;
        }


        //-------------------------------------------
        //
        // PostConstruct
        //
        //-------------------------------------------


        [PostConstruct]
        public function init():void
        {

        }

        //-------------------------------------------
        //
        // Constructor
        //
        //-------------------------------------------

        public function ApplicationContainerPM()
        {
        }



        //-------------------------------------------
        //
        // Mediator Handlers
        //
        //-------------------------------------------

        [EventHandler(event="NavigationEvent.VIEW_AC_ALERT", priority="990")]
        [EventHandler(event="NavigationEvent.VIEW_AC_PLAY", priority="990")]
        [EventHandler(event="NavigationEvent.VIEW_AC_PLACEHOLDER", priority="990")]
        public function goto(event:NavigationEvent):void
        {
            log.logToConsole(this, "goto() " + event.type);


            switch (event.type)
            {
                case NavigationEvent.VIEW_AC_PLACEHOLDER:
                    currentStateView=ApplicationConstants.VIEW_AC_PLACEHOLDER;
                    break;
                case NavigationEvent.VIEW_AC_PLAY:
                    currentStateView=ApplicationConstants.VIEW_AC_PLAY;
                    break;

                case NavigationEvent.VIEW_AC_ALERT:
                    currentStateView=ApplicationConstants.VIEW_AC_ALERT;
                    break;

            }
        }

        //-------------------------------------------
        //
        // Public Methods
        //
        //-------------------------------------------


        //-------------------------------------------
        //
        // Private Methods
        //
        //-------------------------------------------


    }
}